<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>毕业倒计时</title>
	<style>
		p{
			text-align: center;
			font-size: 3em;
			color: red;
		}
	</style>
</head>
<body>
	<p></p>
</body>
<script>
	var date = new Date("2017-5-12");
	var tt = date.getTime();
	var pEl = document.querySelector("p");
	var timer = setInterval(function(){
		var nowDate = new Date();
		var nowtt = nowDate.getTime();
		var sub = (tt-nowtt)/1000;

		// 还剩多少天
		var day = parseInt(sub/(3600*24));
		sub%=(3600*24);
		// sub= sub%=(3600*24);

		var hour = parseInt(sub/3600);
		sub%=3600;
		var minute =parseInt(sub/60);
		var second = parseInt(sub%60);
		var str = "距离我们高薪就业还有"+day+"天"+hour+"小时"+minute+"分钟"+second+"秒";

		pEl.innerHTML=str;
	},500);
	function targetTime(){
		
	}
</script>
</html>